using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.CompositeWeb;
using WCSFContrib.Extensions.CompositeWeb.Services;
using WCSFContrib.Extensions.CompositeWeb.Interfaces;
using Microsoft.Practices.CompositeWeb.Interfaces;
using System.Web.UI;

namespace WCSFContrib.Extensions.CompositeWeb
{
    public class ExtendedWebClientApplication : WebClientApplication
    {
        public ExtendedWebClientApplication()
        {
        }
        
        protected override void AddRequiredServices()
        {
            RegisterServices(this.RootContainer);

            base.AddRequiredServices();
        }

        public static void RegisterServices(ICompositionContainer rootContainer)
        {
            rootContainer.Services.AddNew<WebConfigModuleInfoStore, ICustomModuleInfoStore>();
            rootContainer.Services.AddNew<WebModuleEnumerator, IModuleEnumerator>();
            rootContainer.Services.AddNew<ModuleLoaderService, IModuleLoaderService>();
            rootContainer.Services.AddNew<ServiceLoader, IServiceLoader>();
        }
    }
}
